<?php
$config = Configure::read('Newsletter');
$message = $config['header_message_text'];
$title = $config['newsletter_title'];
$root_url = FULL_BASE_URL . $this->webroot;

$message = str_replace('%link_view%',$root_url . 'newsletter/mails/show/'. $mail['Mail']['id'], $message);
$message = str_replace('%link_unsubscribe%',$root_url . 'newsletter/subscriptions/unsubscribe/', $message);
$message = str_replace('%link_homepage%',$root_url, $message);

?>
[ <?php echo strtoupper($title); ?> • <?php __('Date of sending')?> <?php echo date('d.m.Y', $time->toUnix($mail['Mail']['created']));?> ]


<?php
$body_replace = array(
"/^h1\.\s([^\r]+)[?=\r]/me" => "'== '.strtoupper('\\1').' =='",
"/^h[2-6]\.\s([^\r]+)[?=\r]/me" => "'= '.strtoupper('\\1').' ='",
"/^p\(.*\)\.\s([^\r]+)[?=\r]/m" => "*\\1*",
"/^!(.*?)\(/m" => '(Bilde: '
);

$body = preg_replace(array_keys($body_replace), array_values($body_replace), $mail['Mail']['content']);
echo $body;
?>


--------------------------------------
<?php echo $message; ?> 
